<template>
  <div class="list">
    <header>
      <span class="logo">
        <img src="../img/2.gif" alt />
      </span>
      <span>排行榜</span>
      <span class="return" @click="back()">
        <van-icon name="arrow-left" />
      </span>
    </header>
    <div class="list_menu">
      <div class="search">
        <van-icon name="search" />
        <input type="text" placeholder="请输入需要查询的经纪人" v-model="value" @input="search(value)" />
      </div>
    </div>
    <div class="list_midd">
      <li class="olist" v-for="(item,idx) in list" :key="idx" @click="toDetail(item)">
        <img :src="item.head" alt />
        <p>{{item.id}}</p>
        <p>{{item.name}}</p>
      </li>
    </div>
  </div>
</template>

<script>
import axios from "../../ulis/request";
export default {
  data() {
    return {
      list: [],
      value: ""
    };
  },
  created() {
    //调用函数
    this.getList();
  },
  methods: {
    //渲染数据
    getList() {
      axios({
        url: "/api/rankingList",
      }).then(res => {
        if (res.data.code === 1) {
          this.list = res.data.data;
        } else {
          this.$router.push(`/login`);
        }
      });
    },
    //返回上一级
    back() {
      this.$router.push(`/`);
    },
    toDetail(item) {
      this.$router.push(`/broker_Detail/${item.id}`);
    },
    search(value) {
      axios({
        url: "/api/rankingSearchs",
        method: "post",
        data: {
          value: value
        }
      }).then(res => {
        this.list = res.data.data;
      });
    },
    
  }
};
</script>

<style>
.list {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.list header {
  width: 100%;
  height: 60px;
  background-color: #2997fb;
  text-align: center;
  line-height: 60px;
}

.list header span {
  color: white;
  float: right;
  margin-right: 80px;
  /* vertical-align: middle; */
  font-size: 18px;
}

.list header .logo {
  float: right;
  margin-right: 10px;
}

.list header .return {
  float: left;
  margin-left: 30px;
  vertical-align: middle;
  margin-top: 3px;
}

.list_menu {
  width: 100%;
  height: 250px;
  background: #ff8b8d;
  position: relative;
}
.search {
  width: 85%;
  height: 35px;
  margin-left: 30px;
  background: rgba(247, 247, 247, 0.6);
  border-radius: 5px;
  margin-top: 10px;
  color: #fff;
}
.search .van-icon {
  font-size: 20px;
  line-height: 34px;
  color: #fff;
  padding-left: 10px;
}
.search input {
  font-size: 16px;
  width: 250px;
  border: none;
  outline: none;
  background: rgba(247, 247, 247, 0);
  padding-left: 10px;
}
.list_midd {
  display: flex;
  flex-wrap: wrap;
  position: absolute;
  top: 160px;
  left: 0;
}
.list_midd li {
  width: 32%;
  height: 180px;
  background: #fff;
  border-radius: 10px;
  text-align: center;
  margin-left: 2px;
  border: 1px solid rgb(240, 240, 240);
  line-height: 20px;
}
.list_midd li:nth-child(3) {
  position: absolute;
  top: 40px;
  left: 66%;
  /* background: hotpink; */
}
.list_midd li:nth-child(1) {
  position: absolute;
  top: 0px;
  left: 33%;
  /* background: hotpink; */
}
.list_midd li:nth-child(2) {
  position: absolute;
  top: 40px;
  left: 0px;
  /* background: hotpink; */
}
.list_midd li:nth-child(4) {
  width: 95%;
  height: 90px;
  margin-top: 230px;
  display: flex;
  margin-left: 7px;
  /* background: hotpink; */
}
.list_midd li:nth-child(4) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(5) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(6) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(7) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(8) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(9) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(10) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(11) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(12) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(13) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(14) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(15) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(16) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(17) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(18) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(19) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(20) img {
  width: 70px;
  height: 70px;
  margin-left: 10px;
}
.list_midd li:nth-child(4) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(5) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(6) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(7) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(8) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(9) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(10) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(11) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(12) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(13) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(14) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(15) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(16) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(17) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(18) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(19) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(20) p {
  padding-top: 20px;
  padding-left: 10px;
}
.list_midd li:nth-child(5) {
  width: 95%;
  height: 90px;
  display: flex;
  margin-left: 7px;
  margin-top: 10px;
  /* background: hotpink; */
}
.list_midd li:nth-child(6) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(7) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(8) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(9) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(10) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(11) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(12) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(13) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(14) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(15) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(16) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(17) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(18) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(19) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li:nth-child(20) {
  width: 95%;
  height: 90px;
  display: flex;
  /* background: hotpink; */
}
.list_midd li p:nth-of-type(1) {
  font-size: 20px;
  font-weight: bold;
  color: rgb(255, 81, 0);
}
.list_midd li p:nth-of-type(2) {
  font-size: 18px;
  font-weight: bold;
  color: #000;
}
.list_midd li img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-top: 10px;
}
/* .list_middle {
  flex: 1;
  overflow-y: auto;
} */
</style>